package com.xbongbong.paas.model.impl;

import com.xbongbong.paas.model.ContractCompareUserModel;
import com.xbongbong.paas.toolbox.util.CollectionsUtil;
import com.xbongbong.pro.domain.dao.ContractCompareUserDao;
import com.xbongbong.pro.domain.entity.ContractCompareUserEntity;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author zsn
 */
@Service("contractCompareUserModel")
public class ContractCompareUserModelImpl implements ContractCompareUserModel {
    @Resource
    private ContractCompareUserDao contractCompareUserDao;

    @Override
    public Integer insert(ContractCompareUserEntity entity) {
        return contractCompareUserDao.insert(entity);
    }

    @Override
    public void insertBatch(List<ContractCompareUserEntity> list) {
        contractCompareUserDao.insertBatch(list);
    }

    @Override
    public List<ContractCompareUserEntity> findEntitys(Map<String, Object> param) {
        return contractCompareUserDao.findEntitys(param);
    }

    @Override
    public Integer getEntitysCount(Map<String, Object> param) {
        return contractCompareUserDao.getEntitysCount(param);
    }

    @Override
    public Integer update(ContractCompareUserEntity entity) {
        return contractCompareUserDao.update(entity);
    }

    @Override
    public Integer updateBatch(List<ContractCompareUserEntity> list, String corpid) {
        if (CollectionsUtil.isNotEmpty(list)){
            Integer n = contractCompareUserDao.updateBatch(list, corpid);
            return n;
        }
        return null;
    }

    @Override
    public ContractCompareUserEntity getByKey(Long key, String corpid) {
        return contractCompareUserDao.getByKey(key, corpid);
    }

    @Override
    public List findEntitysWithoutSub(Map<String, Object> param) {
        return contractCompareUserDao.findEntitys(param);
    }
}
